﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Questions.aspx.vb" Inherits="Training.Questions" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Training - Training:: Quiz Questions</title>
<link rel="Stylesheet" type="text/css" media="screen" href="../css/adminStyle.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="ctr">
        <h2>Quiz Questions</h2>
        
        <p>(Image Placement: 0 = right, 1 = top)</p>
        
        <asp:GridView ID="gvQuestions" Width="100%" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" CellPadding="0" 
            DataKeyNames="QuestionID" DataSourceID="dsQuestions" PageSize="25" 
            EmptyDataText="No Questions Available">
            <RowStyle CssClass="row1" />
            <EmptyDataRowStyle CssClass="row1" />
            <Columns>
                <asp:BoundField DataField="Question" HeaderText="Question" 
                    SortExpression="Question">
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="QuestionImage" HeaderText="Image" 
                    SortExpression="QuestionImage">
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="View Image">
                    <ItemTemplate>
                        <%#ViewImage(Eval("QuestionImage"))%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ImagePlacement" HeaderText="ImagePlacement" 
                    SortExpression="ImagePlacement">
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:HyperLinkField DataNavigateUrlFields="QuestionID" 
                    DataNavigateUrlFormatString="EditQuestion.aspx?qsid={0}" HeaderText="Edit/Delete" 
                    Text="edit - delete">
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
                </asp:HyperLinkField>
            </Columns>
            <PagerStyle CssClass="small" />
            <HeaderStyle CssClass="rowHead" ForeColor="White" />
            <EditRowStyle CssClass="row1" />
            <AlternatingRowStyle CssClass="row2" />
        </asp:GridView>
        
        <p><a href="AddNewQuestion.aspx">Add Question</a></p>
        
        <p><a href="QuizControl.aspx">Quiz Control</a> - 
        <a href="Default.aspx">Admin Main</a></p>
    
    </div>
    
    <asp:SqlDataSource ID="dsQuestions" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Conn %>" 
        SelectCommand="SELECT [QuestionID], [Question], [QuestionImage], [ImagePlacement] FROM [QuizQuestions]"></asp:SqlDataSource>
    </form>
</body>
</html>
